#include "../src/glBarChart.hpp"
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <stdexcept>

glBarChart chart;

int main()
{
  if(!glfwInit())
    throw std::runtime_error("glfwInit error");
  glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
  glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5);
  GLFWwindow* window=glfwCreateWindow(600, 600, "test", nullptr, nullptr);
  glfwMakeContextCurrent(window);
  if(glewInit()!=GLEW_OK)
    throw std::exception();
  glfwSwapInterval(1);
  chart.Init();
  while(!glfwWindowShouldClose(window))
  {
    chart.Render();
    glfwSwapBuffers(window);
    glfwPollEvents();
  }
  glfwDestroyWindow(window);
  glfwTerminate();
}
